-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ROS2 port #48
ROS2 port #48
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot judge this PR. I'm not an expert for ROS 2.
I suggest to split reformatting from actual changes. Right now, it's hard to review this PR at all.
Travis is not yet succeeding.
test/test.py
Outdated
self.assertTrue( xml_matches(robot.to_xml_string(False),expected)) | ||
|
||
|
||
# def test_simple_srdf(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why disabling this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this. I restored it
def test_complex_srdf(self): | ||
datadir=rospkg.RosPack().get_path('srdfdom')+"/test/resources/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file contains a lot of unnecessary reformatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the reformatting is necessary as it is bad style to change indentation mid file. I have refactored my changes so that the whitespace changes are in a separate commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhaschke is right, this should be in a separate PR
@henningkayser Please review |
I have split up the PR into separate commits for formatting and porting
This is because moveit_ci is still broken: Porting srdfdom is one step in getting moveit_ci ported to ROS2. |
I think, the only thing you need is to provide the corresponding docker container. Didn't you work on that already?
srdfdom is completely unrelated to moveit_ci. |
It is a WIP. We realized that quite a few of the dependencies (eg srdfdom) weren't building correctly so we are porting them now.
Not exactly. The travis.yml for srdfdom clones moveit_ci and runs travis.sh from that repo. Porting everything is going to be kind of a chicken and the egg problem so we choose to start with the dependencies |
@vmayoral Can you give this a quick review? |
There is a clear dependency chain, isn't it?
|
moveit_ci pulls in https://raw.githubusercontent.com/ros-planning/moveit/$ROS_DISTRO-devel/moveit.rosinstall It also tries do download the docker image for MoveIt which isn't for crystal yet. If we get the base moveit docker image building and update the rosinstall (without CI passing) then the chain will be broken and we'll be all clear to port moveit_ci |
What is pulled in by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix clang. Also rosdep still fails because of urdfdom_py, but I guess this will only be fixed by ros/urdf_parser_py#41
{ | ||
srdf::Model s; | ||
urdf::ModelInterfaceSharedPtr u = loadURDF(std::string(TEST_RESOURCE_LOCATION) + "/pr2_desc.urdf"); | ||
|
||
std::string package_name = "srdfdom"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
or constexpr char[]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like over-optimization ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm with Dave here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm with Henning. Adding a const doesn't harm and clearly states that this variable will not be modified.
@@ -1,3 +0,0 @@ | |||
<launch> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that ros2 uses a different test approach, but is the replacement in this PR? I don't see it. If not, I think we should keep this with an in-line TODO (and maybe matching Issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ros2 tests the .cpp without needing .test files
def test_complex_srdf(self): | ||
datadir=rospkg.RosPack().get_path('srdfdom')+"/test/resources/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhaschke is right, this should be in a separate PR
|
||
TEST(TestCpp, testSimpleUTF) | ||
{ | ||
testSimple("nl_NL.UTF-8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
{ | ||
srdf::Model s; | ||
urdf::ModelInterfaceSharedPtr u = loadURDF(std::string(TEST_RESOURCE_LOCATION) + "/pr2_desc.urdf"); | ||
|
||
std::string package_name = "srdfdom"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like over-optimization ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious, how the new ROS2 approach to integration tests looks like.
The approach you took here, explicitly coding the two environment options in the cpp files, works here, but for more complex scenarios that's not a feasible approach anymore. Sometimes, we need to launch several nodes to perform an integration test...
|
||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These shouldn't be part of a CMakeLists file, but rather defined by the user.
find_package(console_bridge REQUIRED) | ||
find_package(urdfdom_headers REQUIRED) | ||
find_package(urdf REQUIRED) | ||
find_package(tinyxml_vendor REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these *_vendor
packages?
You add many new find_packages, but don't use them in include_directories
or target_link_libraries
.
I don't think they are really needed. Please clean up if possible or better explain.
|
||
before_script: | ||
- git clone -q --depth=1 https://github.com/ros-planning/moveit_ci.git .moveit_ci | ||
- git clone -q -b ros2 --depth=1 -b ros2 https://github.com/ros-planning/moveit_ci.git .moveit_ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One --branch ros2
is sufficient 😉
|
||
<build_depend>boost</build_depend> | ||
<build_depend>cmake_modules</build_depend> | ||
<build_depend>python_cmake_module</build_depend> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmake_modules wasn't related to python in ROS1. Do you really need this package? What does it do?
{ | ||
srdf::Model s; | ||
urdf::ModelInterfaceSharedPtr u = loadURDF(std::string(TEST_RESOURCE_LOCATION) + "/pr2_desc.urdf"); | ||
|
||
std::string package_name = "srdfdom"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm with Henning. Adding a const doesn't harm and clearly states that this variable will not be modified.
This ports srdfdom to ROS2. Both python and C++ tests pass